// Create a search control
var searchControl = new GSearchControl();

// Add in a full set of searchers
var localSearch = new GlocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new GwebSearch());
searchControl.addSearcher(new GvideoSearch());
searchControl.addSearcher(new GblogSearch());

var centerPoint =  'Santa Clara, CA';
var defaultSearch = 'ajax java';

if (typeof widget.args != 'undefined') {
    if (typeof widget.args.centerPoint != 'undefined') {
        centerPoint = widget.args.centerPoint;
    }
    if (typeof widget.args.defaultSearch != 'undefined') {
        defaultSearch = widget.args.defaultSearch;
    }
}

// Set the Local Search center point
localSearch.setCenterPoint(widget.args.centerPoint);

// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById(widget.uuid));

// Execute an inital search
searchControl.execute(widget.args.defaultSearch);